Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Search  for  Two  Items  in  a  Text  File  

 Content of Search for Two Items in a Text File.vbs
MD5 Hash: 651675FC687724835F19CA81AB973537
Const ForReading = 1
blnFound = False

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.txt", ForReading)
strContents = objFile.ReadAll
objFile.Close

If InStr(strContents, "Windows 2000") Then
blnFound = True
End If

If InStr(strContents, "Windows XP") Then
blnFound = True
End If

If blnFound Then
Wscript.Echo "Either Windows 2000 or Windows XP appears in this file."
Else
Wscript.Echo "Neither Windows 2000 nor Windows XP appears in this file."
End If



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a